home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / 3dexp.zip / README < prev   
Text File  |  1992-05-22  |  2KB  |  59 lines

  1.  
  2.                                 3D-EXP
  3.  
  4.                           By Rich Geldreich
  5.  
  6.                             May 22nd, 1992
  7.                             
  8.  
  9.     3D-EXP  is  a  little   QuickBASIC  4.5  wireframe  program  I
  10. developed to show people that,  yes,  it is possible to  produce  some
  11. cool 3-D animation in a high level language(in this case, QuickBASIC).
  12. Try it out(compiled).  I'm sure you'll like it.
  13.     
  14.     So how did you get it so fast, you ask?  Easy.  Just don't use
  15. any  floating point math!!   That's the secret.   Integer only math is
  16. MUCH quicker than floating point math...  This program is an excellent
  17. example.   One thing of interest:  Did you know that the "/" divide is
  18. actually a floating point  divide(even  if you are dividing integers)?
  19. Use the "\" divide symbol whenever you don't need a decimal  answer...
  20.  
  21.     The  program  is  documented,   so I'm not going to explain it
  22. here.  Have fun- it's public domain.  Just don't distribute a modified
  23. version of it unless you also put your name on it too. Thanks.
  24.  
  25.  
  26.     Integer   math   is   actually  very  easy(if  you  understand
  27. fractions).   Lets say you want to  multiply a number by .8 The normal
  28. code to do this would be:
  29.  
  30.     B% = A% * .8
  31.     
  32.     That's okay... but there's a much quicker way. Why not this:
  33.     
  34.     B% = (A% * 8) \ 10
  35.     
  36.     At first this statement looks slower because it has  an  extra
  37. divide. It's not- it's actually MUCH quicker. Why? 
  38.  
  39.     The  ".8"  in  the  first  statement  invokes  an  ultra slow,
  40. mediocre floating point multiply.   The second  statement,   which  is
  41. actually:
  42.  
  43.     B% =  8 * A&
  44.          --------
  45.             10
  46.     
  47.     does not. Clear as mud, right? Have fun figuring out this one...
  48.     
  49.  
  50.     If you have any questions or ideas, write/call:
  51.     
  52.  
  53.     Rich Geldreich
  54.     410 Market St.
  55.     Gloucester City, NJ 08030
  56.     (609)-742-8752
  57.     
  58.     
  59.